﻿using FactoryMethod.FactoryMethod;
using FactoryMethod.Interface;
using System;

namespace FactoryMethod
{
    /// <summary>
    /// 工厂方法
    /// </summary>
    public class Program
    {
        static void Main(string[] args)
        {
            IFactory hunanFactory = new HumanFactory();
            IRace human = hunanFactory.CreateInstance();

            IFactory neFactory = new NEFactory();
            IRace ne = neFactory.CreateInstance();

            IFactory fifthFactory = new FifthFactory();
            IRace fifthRace = fifthFactory.CreateInstance();

            Player player = new Player()
            {
                Id = 123,
                Name ="mage"
            };
            player.Play(human);
            player.Play(ne);
            player.Play(fifthRace);
        }
    }
}
